<extend name="Public:base"/>

<!--侧边导航-->
<block name="aside">
    <include file="Public:aside"/>
</block>

<block name="main">

<div class="table-toolbar">
    <div class="row">
        <div class="col-md-12">
            <a class="btn btn-primary" href="{:U('User/add')}"> 新增</a>
            <a class="btn btn-primary">删除</a>
        </div>
    </div>
</div>

<div class="row table-container">
    <div class="col-md-12">
        <form name="myform" action="{:U('user/deleteall')}" method="post">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                <tr>
                    <th style="width:20px;"><input type="checkbox" id="check_box" onclick="selectall('ids[]');" /></th>
                    <th>用户名</th>
                    <th>邮箱</th>
                    <if condition="$Think.session.admin.id eq 1">
                        <th>所属角色</th>
                    </if>
                    <th>最后登录时间</th>
                    <th>状态</th>
                    <th>操作管理</th>
                </tr>
                </thead>

                <tbody>
                <empty name="list">
                    <tr class="table-data-empty">
                        <td class="text-center empty-info" colspan="8">
                            <i class="fa fa-database"></i> 暂时没有数据<br>
                        </td>
                    </tr>
                    <else/>
                    <volist name="list" id="vo" key="k">
                        <tr>
                            <td><input class="inputcheckbox " name="ids[]" value="{$vo['id']}" type="checkbox" ></td>
                            <td>{$vo.username}</td>
                            <td>{$vo.email}</td>
                            <if condition="$Think.session.admin.id eq 1">
                            <td>{$role[$vo['role']]}</td>
                            </if>
                            <td>{$vo['last_login_time']|date="Y-m-d H:m:s",###}</td>
                            <td><eq name="vo.status" value="1"><font color="red">√</font><else/><font color="blue">×</font></eq>
                            </td>
                            <td>
                                <a class="btn btn-xs btn-primary" href="{:U('User/edit','id='.$vo['id'])}">编辑</a>
                                <a class="btn btn-xs btn-danger" href="javascript:confirm_delete('{:U('User/delete',array('id'=>$vo['id']))}')">删除</a>
                            </td>
                        </tr>
                    </volist>
                </empty>
                </tbody>
            </table>

        </form>

        <div class="pagination">{$page}</div>
    </div>

</div>


</block>